package com.biz.primus.management.adv.degraded;

import com.biz.primus.base.exception.BizBusinessException;
import com.biz.primus.base.vo.PageVo;
import com.biz.primus.common.vo.SpringPageVO;
import com.biz.primus.model.adv.enums.AdUsePlace;
import com.biz.primus.model.adv.enums.UseType;
import com.biz.primus.model.adv.vo.AdPositionVo;
import com.biz.primus.model.adv.vo.AdvertisementQueryVo;
import org.springframework.stereotype.Component;

import com.biz.primus.management.adv.feign.AdvFeignClient;
import com.biz.primus.model.adv.vo.AdvertisementVo;

import lombok.extern.slf4j.Slf4j;

import java.math.BigDecimal;
import java.util.Collections;
import java.util.List;

/**
 * adv feign client熔断策略,统一以Degraded+{对应feign client类名}来命名
 *
 * @author jun.liu
 * @date 2017/9/19
 */
@Component
@Slf4j
public class DegradedAdvFeignClient implements AdvFeignClient {

    @Override
    public List<AdPositionVo> queryAdByUseType(UseType utype) {
        return Collections.EMPTY_LIST;
    }

    @Override
    public void addOrUpdateAdInfo(AdvertisementVo advo) {
        throw new BizBusinessException("SaveOrUpdate Advertisement Is Exception");
    }

    @Override
    public void addOrUpdateAdPositionInfo(AdPositionVo input) {
        throw new BizBusinessException("SaveOrUpdate AdPosition Is Exception");
    }

    @Override
    public void deleteAdById(long id) {
        throw new BizBusinessException("Delete Advertisement By Id Is Exception");
    }

    @Override
    public void deleteAdPositionById(long id) {
        throw new BizBusinessException("Delete AdPosition By Id Is Exception");
    }

    @Override
    public List<AdvertisementVo> getAllAds() {
        return Collections.EMPTY_LIST;
    }

    @Override
    public List<AdvertisementVo> getAdsByPositionId(long positionId) {
        return Collections.EMPTY_LIST;
    }

    @Override
    public List<AdPositionVo> getAdPositions() {
        return Collections.EMPTY_LIST;
    }

    @Override
    public AdPositionVo getAdPositionById(long positionId) {
        throw new BizBusinessException("get AdPosition By Id Is Exception");
    }

    @Override
    public AdvertisementVo getAdById(long adId) {
        throw new BizBusinessException("get Advertisement By Id Is Exception");
    }

    @Override
    public SpringPageVO<AdvertisementVo> getAdsByParams(AdvertisementQueryVo queryVo) {
        return new SpringPageVO<>();
    }

    @Override
    public SpringPageVO<AdPositionVo> getAllAdPositions(PageVo vo) {
        return new SpringPageVO<>();
    }

    @Override
    public AdPositionVo findAdByProvinceId(BigDecimal latitude, BigDecimal longitude, AdUsePlace adUsePlace) {
        throw new BizBusinessException("get AdPositionVo By latitude and longitude and adUsePlace Is Exception");
    }

    @Override
    public AdPositionVo getAdpositionCountry(AdUsePlace adUsePlace) {
        throw new BizBusinessException("get AdPositionVo By adUsePlace Is Exception");
    }

    @Override
    public boolean findAdPositionByUsePlace(AdUsePlace adUsePlace) {
        return false;
    }
}
